package org.source.test;

/**
 * 事件管理者(事件通知者)
 * @author jack
 *
 */
public class EventNotifier {
	private EventDefinition ie;
    private boolean somethingHappened;//somethingHappened 来标志事件是否发生

    public EventNotifier(EventDefinition event) {
        ie = event;
        somethingHappened = true;
    }

    public void doWork() {
        if (somethingHappened) {
            // 事件发生时，通过调用接口的这个方法来通知
            ie.interestingEvent("ssssss");
        }        
    }
}

